<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    function func1() {
        return new Promise((resolve, reject) => {
            resolve('321');
        })
    }

    function func2() {
        return new Promise((resolve, reject) => {
            resolve('123');
        })
    }

    Promise.race([
        func1(),
        func2()
    ])
        .then(result => {
            console.log(result);
        })
        .catch(reason => {
            console.log(reason);
        })
</script>
</html>